<?php
global $_W,$_GPC;
$settings = $this->module['config'];
$share = pdo_get($this->modulename . "_ad", array("cateid" => 84, "uniacid" => $_W["uniacid"]));
if(!$share){$share['title'] = $settings['sharetitle'];$share['thumb'] = tomedia($settings['sharethumb']);}
$keyword = trim($_GPC["keyword"]);
$cityid = intval($_GPC["cityid"]);
if(!$cityid){$cityid = 40;}
$lon = $_GPC["lon"];
$lat = $_GPC["lat"];
$time = time();
$data = array("appKey" => $settings['movie_api_s_appKey'], "time" => $time, "cityId" => $cityid);
$sign = $this->get_sign($data, $settings['movie_api_s_appSecret']);
$data["sign"] = $sign;
$url = $settings['movie_api_s_url2'] . "movieapi/movie-info/get-hot-list";
$res = $this->geturl($url,$data);
if (!empty($keyword)) {
	$res["data"]['list'] = $this->search($res["data"]['list'], $keyword);
}
$hot = $res["data"]['list'];
$c = 0;
foreach($hot as $k=>$v){
	if(strtotime($v['publishDate'])<time()){
		$hot[$k]['status'] = 1;
	}else{
		$hot[$k]['status'] = 0;
		$indexcome[$c] = $v;
		$indexcome[$c]['status'] = 0;
		$c++;
	}
}
$hot = $hot;
$hotshuliang = count($res["data"]['list']);
$hotindex = array_slice($hot,0,10);
$indexcomeshuliang = count($indexcome);
$indexcome = array_slice($indexcome,0,10);
$resArr['movie'] = array("hotshuliang" => $hotshuliang, "hot" => $hot, "hotindex" => $hotindex,"comeshuliang" => $comeshuliang, "come" => $come, "cinema" => $cinema,'indexcome' => $indexcome,'indexcomeshuliang' => $indexcomeshuliang, 'sharetitle' => $share['title'], 'sharepic' => tomedia($share['thumb']));
exit(json_encode($resArr['movie']));
